import Http from '../http';

// 分页查询
export const treeManager = function(queryWhere: any) {
    return Http.post('/sysMenu/treeManager',queryWhere)
}

// 超级管理员新增
export const queryTree = function(objInfo: any) {
    return Http.post(`/sysMenu/queryTree?id=${objInfo}`,{})
}

// 超级管理员编辑
export const insertOrUpdate = function(objInfo: any) {
    return Http.post('/sysMenu/insertOrUpdate',objInfo)
}

// 超级管理员删除角色
export const delBySuper = function(dels: any) {
    return Http.delete(`/sysRole/dels?idList=${dels}`,{})
}


// 查询当前用户的角色
export const queryForUserId = function(userId: any) {
    return Http.post(`/sysUserRole/queryForUserId?userId=${userId}`,{})
}

// 用户绑定角色
export const roleBindUser = function(bindObj: any) {
    return Http.post('/sysUserRole/roleBindUser',bindObj)
}

// 用户移出绑定角色
export const roleBindUserRemove = function(bindObj: any) {
    return Http.post('/sysUserRole/roleRemoveUser',bindObj)
}


// 超级管理员批量删除角色
export const delsBySuper = function(delUrl: any) {
    return Http.delete(`/sysRole/dels${delUrl}`,{})
}


// 超级管理员授权菜单
export const dispenseMenuTree = function(id: any) {
    return Http.post(`/sysRoleMenu/dispenseMenuTree?id=${id}`,{})
}

// 超级管理员角色绑定菜单
export const roleBindMenu = function(roleBindMenuVo: any) {
    return Http.post('/sysRoleMenu/roleBindMenu',roleBindMenuVo)
}